<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>前台</title>
<style>
.nav{width:100%;height:20px}ul,li{margin:0;padding:0}li{float:left;list-style-type:none;margin-right:10px;display:block}	
#no, .form_no{
display:none;
	}
#yes{
	display:block;
	}	
</style>
</head>

<body>
<ul class="nav">
  <li><a href="index.php">首页</a></li>
  <li><a href="admin.php">后台</a></li>
  <li id="<?php 
       if(isset($_COOKIE['nav'])){
		   echo "yes";
		   }else{
		  echo "no";}
	      ?>"><a href="x.php">神奇的魔法</a></li>
</ul>

<hr>
<?php
if(isset($_COOKIE['nav'])){
	echo "<div class='form_no'>";
}else
?>
<form method="post" action="conn.php?login=in">
  <label for="textfield">登陆:</label>
  <input type="text" name="username" >
  <label for="textfield2">密码:</label>
  <input type="password" name="password">
  <input type="submit" value="提交">
</form>
</div>
<?php
{
	echo "<div>";
}
?>


</body>
</html>


